<template>
  <article class="article-card">
    <h2 class="article-title">
      <router-link :to="'/article/' + article.id">{{ article.title }}</router-link>
    </h2>
    <div class="article-meta">
      <span class="date">{{ article.date }}</span>
      <span class="tags" v-if="article.tags && article.tags.length">
        ·
        <span v-for="(tag, index) in article.tags" :key="index">
          {{ tag }}<span v-if="index < article.tags.length - 1">, </span>
        </span>
      </span>
    </div>
    <p class="article-excerpt">{{ article.excerpt }}</p>
  </article>
</template>

<script>
export default {
  name: 'ArticleCard',
  props: {
    article: {
      type: Object,
      required: true
    }
  }
}
</script>

<style scoped>
.article-card {
  background: white;
  padding: 20px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.article-title {
  font-size: 1.5rem;
  margin: 0 0 10px 0;
}

.article-title a:hover {
  text-decoration: none;
  color: #000;
}

.article-meta {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.article-excerpt {
  margin: 0;
  color: #555;
}
</style>